LOG_FILE=$1
SMB_IP=$2
SMB_SHARE=$3
LOGIN=$4
PASS=$5

MNT_POINT=/tmp/$SMB_IP/$SMB_SHARE

case "$#" in
3)
	mkdir -p $MNT_POINT
	mount -t cifs //$SMB_IP/$SMB_SHARE $MNT_POINT -o guest,ro
	;;
5)
	mkdir -p $MNT_POINT
	mount -t cifs //$SMB_IP/$SMB_SHARE $MNT_POINT -o username=$LOGIN,password=$PASS,ro
	;;
*)
	echo "syntax: ./smb_mount.sh log ip share [login] [password]"
	exit 1
	;;
esac

cd /tools/password/unix/passgrep
python passGrep.py -r $MNT_POINT -f -m 1 -d 3 -y -o $LOG_FILE

umount $MNT_POINT
rm -r /tmp/$SMB_IP


